Color image acquisition systems are widespread nowadays. Several systems and methods are used to capture scenes and display images in color spaces. The cheapest color imaging sensors are those using a “single imaging site” (as described in the Bayer's patent, “Color imaging array” U.S. Pat. No. 3,971,065). A popular example of a single-site sensor is a Bayer sensor.
A Bayer acquisition system is a sensor system that captures scene information in the form of a color pattern. An image output by such a sensor is stored in a particular pattern format. This pattern is characterized by including on a first row of an image, alternating pixels of Red and Green, and then on a next row alternating pixels of Blue and Green. The pattern shown in FIG. 1 is repeated to fill the image.
An example of the Bayer pattern for the first 4 rows of pixels is shown in FIG. 2.
In this case, each pixel location contains a value for a single color only. It is to be mentioned that this pattern is an example of possible Bayer patterns. It is known in the art that several patterns can be used to capture scenes using a Bayer acquisition system, although the one described above is the most widespread.
This type of sensor is increasingly popular for the simple reason that they are cheap and extremely simple to construct and use.
However, with a Bayer acquisition system the image obtained is not in a friendly format to be processed or to be displayed. Classical image processing algorithms and display methods are applied to color space images. The image needs to be transformed from a Bayer image to a RGB, YUV or any other color space image.
The Bayer transformation consists of finding the missing information for each pixel according to the information provided by the Bayer image. A well-known method to get a color space image from a Bayer image is “near neighbor averaging” or “linear filtering”. In this method, for each pixel location the missing color component is determined by averaging neighboring pixels that are associated with that missing color. For example, Pi,j represents the value of the Green_2 pixel at position (i,j) as shown in FIG. 3. Values of red, green and blue colors need to be computed at this pixel position.
The three color values are computed as follows:
                    {                                                                              R                                      i                    ,                    j                                                  =                                                      (                                                                  P                                                  i                          ,                                                      j                            -                            1                                                                                              +                                              P                                                  i                          ,                                                      j                            +                            1                                                                                                                )                                    /                  2                                                                                                                          G                                      i                    ,                    j                                                  =                                  P                                      i                    ,                    j                                                                                                                                            B                                      i                    ,                    j                                                  =                                                      (                                                                  P                                                                              i                            -                            1                                                    ,                          j                                                                    +                                              P                                                                              i                            +                            1                                                    ,                          j                                                                                      )                                    /                  2                                                                                        Equation        ⁢                                  ⁢        1            Where Xi,j is the value of color X at position (i,j).
Similarly, if the pixel color is different the equations are different.
The case where at position (i,j) the color is Green_1:
                    {                                                            R                =                                                      (                                                                  P                                                                              i                            -                            1                                                    ,                          j                                                                    +                                              P                                                                              i                            +                            1                                                    ,                          j                                                                                      )                                    /                  2                                                                                                        G                =                                  P                                      i                    ,                    j                                                                                                                          B                =                                                      (                                                                  P                                                  i                          ,                                                      j                            -                            1                                                                                              +                                              P                                                  i                          ,                                                      j                            +                            1                                                                                                                )                                    /                  2                                                                                        Equation        ⁢                                  ⁢        2            
The case where at position (i,j) the color is Red:
                    {                                                            R                =                                  P                                      i                    ,                    j                                                                                                                          G                =                                                      (                                                                  P                                                  i                          ,                                                      j                            -                            1                                                                                              +                                              P                                                  i                          ,                                                      j                            +                            1                                                                                              +                                              P                                                                              i                            -                            1                                                    ,                          j                                                                    +                                              P                                                                              i                            +                            1                                                    ,                          j                                                                                      )                                    /                  4                                                                                                        B                =                                                      (                                                                  P                                                                              i                            -                            1                                                    ,                                                      j                            -                            1                                                                                              +                                              P                                                                              i                            +                            1                                                    ,                                                      j                            -                            1                                                                                              +                                              P                                                                              i                            -                            1                                                    ,                                                      j                            +                            1                                                                                              +                                              P                                                                              i                            +                            1                                                    ,                                                      j                            +                            1                                                                                                                )                                    /                  4                                                                                        Equation        ⁢                                  ⁢        3            
The case where at position (i,j) the color is Blue:
                    {                                                            R                =                                                      (                                                                  P                                                                              i                            -                            1                                                    ,                                                      j                            -                            1                                                                                              +                                              P                                                                              i                            +                            1                                                    ,                                                      j                            -                            1                                                                                              +                                              P                                                                              i                            -                            1                                                    ,                                                      j                            +                            1                                                                                              +                                              P                                                                              i                            +                            1                                                    ,                                                      j                            +                            1                                                                                                                )                                    /                  4                                                                                                        G                =                                                      (                                                                  P                                                  i                          ,                                                      j                            -                            1                                                                                              +                                              P                                                  i                          ,                                                      j                            +                            1                                                                                              +                                              P                                                                              i                            -                            1                                                    ,                          j                                                                    +                                              P                                                                              i                            +                            1                                                    ,                          j                                                                                      )                                    /                  4                                                                                                        B                =                                  P                                      i                    ,                    j                                                                                                          Equation        ⁢                                  ⁢        4            
The Bayer transformation is an essential operation, which cannot be avoided. It is often performed directly in camera systems or on boards containing dedicated hardware elements specifically designed for that purpose. These specialized hardware element are expensive and cannot be used for anything else than a Bayer transform. Other methods use the CPU to perform this transformation. However, in spite of its essential character, the Bayer transform is only a preprocessing operation and its result is often used to do more complex computations. It would be interesting then, to off-load the CPU and use it for other computations.